<template>
  <div class="scroll">
    <vueSeamlessScroll vueSeamlessScroll :data="listData" class="warp" :class-option="classOption">
      <ul class="item">
        <li v-for="(item, index) in listData" :key="index">
          <div class="box">
            <div class="index" style="color:#0092cc" >
              {{ index+1 }}
            </div>
            <div class="content">
              <div class="title">
                <div class="name">
                  姓名:{{ item.name }}
                </div>
                <div class="date">
                  时间:{{ item.date }}
                </div>
              </div>
              <div class="address">
                地址：{{ item.address }}
              </div>
            </div>
            <div class="end" :style="{ 'color': colorArr[item.status] }">
              {{ item.status | formateStatus }}
            </div>
          </div>
        </li>
      </ul>
    </vueSeamlessScroll>
  </div>
</template>
<script>
import { BaseData } from './index'
export default {
  components: {
    vueSeamlessScroll
  },
  data() {
    return {
      listData: BaseData(),
      classOption: {
        direction: 1,
        singleHeight: 50,
        waitTime: 2000
      },
      colorArr: ["red", "yellow", "#ffeebc"]
    }
  },
  methods: {
  },
  created() {
  },
  mounted() {
  },
  filters: {
    formateStatus(value) {
      let arr = ["确诊", "无症状", "疑似"]
      return arr[value]
    }
  }
}
</script>
<style lang="less" scoped>
.warp {
  width: 400px;
  height: 200px;
  margin: 0 auto;

  ul {
    list-style: none;
    padding: 0;
    margin: 0 auto;

    li,
    a {
      display: block;
      height: 50px;
      // line-height: 30px;
      display: flex;
      justify-content: space-between;
      font-size: 15px;
      border-bottom: 2px dashed #00afed;

      .box {
        width: 100%;
        height: 100%;
        display: flex;
        flex-wrap: wrap;

        .index {
          width: 10%;
          height: 100%;
          display: flex;
          align-items: center;
        }

        .content {
          width: 70%;
          height: 100%;
          display: flex;
          justify-content: center;
          flex-direction: column;

          .title {
            display: flex;
            font-size: 14px;

            .name {
              width: 30%;
              height: 100%;
            }

            .date {
              width: 70%;
              display: flex;
              flex-direction: row-reverse;
            }
          }

          .address {
            font-size: 14px;

          }
        }

        .end {
          width: 20%;
          height: 100%;
          display: flex;
          align-items: center;
          justify-content: center;
        }
      }
    }
  }
}

.scroll {
  width: 400px;
  height: 200px;
  overflow: hidden;

}
</style>
